package com.wyj.email.controller;

import com.wyj.email.api.IEmailApi;
import com.wyj.email.entity.EmailBO;
import com.wyj.email.service.IEmailApiImpl;
import com.wyj.response.ApiResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * TODO:
 *
 * @author wuyijie
 * @date 2022/2/9 23:20
 */
@RestController
public class EmailController implements IEmailApi {
    private final IEmailApiImpl iEmailApi;

    public EmailController(IEmailApiImpl iEmailApi) {
        this.iEmailApi = iEmailApi;
    }

    @Override
    public ApiResult<Boolean> send(EmailBO emailBO) {
        return ApiResult.ok(iEmailApi.sendEmail(emailBO));
    }
}
